dBASE code for setting sort fields

The following code demonstrates the use of PEGetNSortFields and PESetNthSortField.

You can use code similar to the following at any time to change the sort field/sort direction:

LOCAL nError, nSortFields, cSortField, nDirection, result
nSortFields = PEGetNSortFields(Job)
IF nSortFields < 0
    nError = PEGetErrorCode(Job)
    && Handle error
    return
ENDIF
cSortField = "{alias.TABLE->FIELD}"
nDirection = PE_SF_ASCENDING
result = PESetNthSortField(Job, nSortFields, cSortField, nDirection)
IF result = .F.
    nError = PEGetErrorCode(Job)
    && Handle error
    PEClosePrintJob(Job)
    return
ENDIF



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com